package com.edu.jvm.unit01.objectInstantiation;

/**
 * 测试对象实例化的过程：
 * 1.加载类元信息->
 * 2.为对象分配内存->
 * 3.处理并发问题->
 * 4.属性的默认初始化(零值初始化)->
 * 5.设置对象的头信息->
 * 6.属性的显示初始化、代码块中、构造器中
 *
 * 初始化赋值顺序：显示赋值>代码块赋值>构造器赋值
 *
 * @author five-five
 * @date 2021/9/25-9:32
 */
public class Customer {
    private int id = 1001;
    private String name;
    private Account account;

    {
        name = "匿名用户";
    }

    public Customer() {
        account = new Account();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }
}
